﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;
using Controller;

namespace Facade
{
    public class KPIAchievementFacade
    {
        public IList<KPIAchievement> GetKPIAchievementTable(int year, int KPIAssignID)
        {
            IList<KPIAchievement> Achievements = new List<KPIAchievement>();
            KPIAchievementController cont = new KPIAchievementController();
            Achievements = cont.GetKPIAchievementTable(year, KPIAssignID);
            return Achievements;
        }

        public string Save(KPIAchievement KPIAchievements)
        {
            KPIAchievementController cont = new KPIAchievementController();
            return cont.Save(KPIAchievements);
        }

        public bool Save(List<KPIAchievement> list, List<KPIAttachment> listAttachment, List<KPIAttachment> listAttachmentDelete)
        {
            KPIAchievementController cont = new KPIAchievementController();
            return cont.Save(list, listAttachment,listAttachmentDelete);
        }

        public bool SaveNoAttachment(List<KPIAchievement> list, List<KPIAttachment> listAttachmentDelete)
        {
            KPIAchievementController cont = new KPIAchievementController();
            return cont.SaveNoAttachment(list, listAttachmentDelete);
        }

        public bool SaveVerificator(List<KPIAchievement> list)
        {
            KPIAchievementController cont = new KPIAchievementController();
            return cont.SaveVerificator(list);
        }

        public string UpdateRelease(KPIAchievement KPIAchievements)
        {
            KPIAchievementController cont = new KPIAchievementController();
            return cont.UpdateRelease(KPIAchievements);
        }

        public KPIAchievement GetKPIAchievementDetail(int month, int year, int KPIAssignID)
        {
            KPIAchievement KPIAchievements = new KPIAchievement();
            KPIAchievementController cont = new KPIAchievementController();
            KPIAchievements = cont.GetKPIAchievementDetail(month, year, KPIAssignID);
            return KPIAchievements;
        }

        public List<KPIAchievement> GetListKPIAchievement(int KPIAssignID)
        {
            KPIAchievementController cont = new KPIAchievementController();
            return cont.GetListKPIAchievement(KPIAssignID);
           
        }

        public string LockKPIAchievement(int month, int year, int KPIAssignID, Employee CurrentUser)
        {
            KPIAchievementController cont = new KPIAchievementController();
            return cont.LockKPIAchievement(month, year, KPIAssignID, CurrentUser);
        }

        public IList<KPIAchievement> GetKPIAchievementByVerificatorID(int Verificator, string sSearch, int PageNumber, int Datalength, string SortCol, string SortDirection, out int TotalData, int year)
        {
            IList<KPIAchievement> KPIs = new List<KPIAchievement>();
            KPIAchievementController cont = new KPIAchievementController();
            KPIs = cont.GetKPIAchievementByVerificatorID(Verificator, sSearch, PageNumber, Datalength, SortCol, SortDirection, out TotalData, year);
            return KPIs;
        }
    }
}